package com.zryc.mapper;

import com.zryc.shop.entity.ProductCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 商品分类表 Mapper 接口
 * </p>
 *
 * @author xujiajun
 * @since 2022-10-17
 */
public interface ProductCategoryMapper extends BaseMapper<ProductCategory> {
    /**
     * 查找当前父类下的 子分类的最大子分类编码
     * @param parentId
     * @return
     */
    @Select("select max(category_code) from product_category where parent_id = #{param1} and category_level=#{param2}")
    String selectMaxCategoryCodeByParentId(Integer parentId,Integer categoryLevel);
}
